<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css" />
		<style type="text/css">
			.am-slider-default{ box-shadow: none;}
			
		</style>
	</head>

	<body>
		<div class="am-g hy-h-8">
         {include file='../Common/hy_header.html'}
			<div class="am-u-sm-5 am-slider-default hy-h hy-js-imgcontainer">

				<div id="your-slider" class="am-slider am-slider-default">
					<ul class="am-slides">
						{foreach from=$plist item=photo}
						<li>
							<img data-id="{$photo.id}" src="{$photo.original_pic}" />
						</li>
						{/foreach}
					</ul>
				</div>

			</div>
			<div class="am-u-sm-6 am-u-end">
				
				<div class="am-form">
					{foreach from=$plist item=photo}
					
					<div id="photo_{$photo.id}" {if $_GET['pid']==$photo.id}style="display: block"{/if} class="hy-hide hy-js-p-content">
						<div class="am-panel-bd am-cf am-collapse" id="collapse-panel-{$photo.id}" style="height: 329px;">
                         <form class="am-form hy-js-form{$photo.id}  hy-js-editphoto ">
                         	<div class="am-g am-margin-top">
						<div class="am-u-sm-2 am-text-right hy-right-label">
							标题
						</div>
						<div class="am-u-sm-10">
							<input name="title" value="{$photo.title} " type="text " class="am-input-sm ">
						</div>
					    </div>
					    <div class="am-g am-margin-top ">
						<div class="am-u-sm-2 am-text-right  hy-right-label">
							描述
						</div>
						<div class="am-u-sm-10 ">
							<textarea name="abstract" rows="4 ">{$photo.abstract}</textarea>
						</div>
					</div>

					{if $_C.DIGLOSSIA==1}
					
					<div class="am-g am-margin-top ">
						<div class="am-u-sm-2 am-text-right ">
							英文标题
						</div>
						<div class="am-u-sm-10 ">
							<input name="en_title" value="{$photo.en_title} " type="text " class="am-input-sm ">
						</div>
					</div>
					<div class="am-g am-margin-top ">
						<div class="am-u-sm-2 am-text-right ">
							英文描述
						</div>
						<div class="am-u-sm-10 ">
							<textarea name="en_abstract" rows="4 ">{$photo.en_abstract}</textarea>
						</div>
					</div>
					{/if}

					<div class="am-margin am-text-right ">
						<input type="hidden" value="{$photo.id}" name="id" />
						<button type="button" class="am-btn am-btn-primary hy-js-submit{$photo.id} am-btn-xs ">提交保存</button>
					</div>
					
                         </form>
                      </div>
                     
					<div class="am-panel am-panel-default admin-sidebar-panel">
					  <button type="button" class="am-fr am-collapsed am-btn  am-btn-xs " data-am-collapse="{ target: '#collapse-panel-{$photo.id}'}">编辑</button>
                      <div class="am-panel-bd">
                            <p>{if $photo.title}<span class="am-icon-tag"></span> {$photo.title}{/if}
        	                 {if $photo.en_title}/{$photo.en_title}{/if}</p>
                            <p style='text-indent: 2rem;'>{if $photo.abstract} {$photo.abstract}{/if}</p>
							<p style='text-indent: 2rem;'>{if $photo.en_abstract}{$photo.en_abstract}{/if}</p>
                        </div>
                    </div>
	 				
					</div>
					{/foreach}
				</div>
				
		{include file='../Common/hy_footer.html'}
	</body>
	<script type="text/javascript">
		$(function() {
			$('#your-slider').flexslider({
				after: function(){ 
					$('.hy-js-p-content').hide();
					var id=$('.am-active-slide img').attr('data-id');
					$('#photo_'+id).show();
				},
				 slideshow: false,
				 startAt: {$index}
			});
			
			
			});
			{foreach from=$plist item=photo}
		    hy_submit('index.php?g=admin&m=article&a=update_photo',{ form:'.hy-js-form{$photo.id}',btn:'.hy-js-submit{$photo.id}'});
		    {/foreach}
	          
	</script>
	

</html>